﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using DevComponents.DotNetBar;
using System.IO;

namespace HYWJ
{
    public partial class FABSForm : Office2007Form
    {
        public FABSForm()
        {
            InitializeComponent();
        }

        private void FABSForm_Load(object sender, EventArgs e)
        {
            
        }

        
        private void button1_Click(object sender, EventArgs e)
        {
            if (richTextBox1.Text == "" || richTextBox2.Text == "")
            {
                MessageBox.Show("请将情况分析和决心制定都填写完成之后再提交！");
                return;
            }
            else
            {
                if (MessageBox.Show("确认提交，提交后将不能更改！", "提示", MessageBoxButtons.OKCancel, MessageBoxIcon.Question) == DialogResult.OK)
                {
                    string filePath = Application.StartupPath + @"\提交文档\情况分析\1.txt";
                    string txt = richTextBox1.Text;
                    File.WriteAllText(filePath, txt, Encoding.Default);

                    string filePath1 = Application.StartupPath + @"\提交文档\决心制定\1.txt";
                    string txt1 = richTextBox2.Text;
                    File.WriteAllText(filePath1, txt1, Encoding.Default);

                    this.Close();
                }
            }

        }

        private void button2_Click(object sender, EventArgs e)
        {
            this.richTextBox1.Text = "";
        }

        private void button6_Click(object sender, EventArgs e)
        {

            this.richTextBox2.Text = "";
        }

    }
}
